<!DOCTYPE HTML>
<html  lang="zh" xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-garden-edit" th:object="${garden}">
            <input id="id" name="id" th:field="*{id}"  type="hidden">
            <div class="form-group">	
                <label class="col-sm-3 control-label">厂商编号(不可修改)：</label>
                <div class="col-sm-8">
                    <input id="teaGardenNo" name="teaGardenNo" th:field="*{teaGardenNo}" class="form-control" type="text" readonly="true">
                </div>
            </div>
            <div class="form-group">	
                <label class="col-sm-3 control-label">厂商名称：</label>
                <div class="col-sm-8">
                    <input id="gardenName" name="gardenName" th:field="*{gardenName}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">	
                <label class="col-sm-3 control-label">法人代表：</label>
                <div class="col-sm-8">
                    <input id="legalPerson" name="legalPerson" th:field="*{legalPerson}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">	
                <label class="col-sm-3 control-label">联系电话：</label>
                <div class="col-sm-8">
                    <input id="phone" name="phone" th:field="*{phone}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">	
                <label class="col-sm-3 control-label">生产地点：</label>
                <div class="col-sm-8">
                    <input id="productAdd" name="productAdd" th:field="*{productAdd}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">	
                <label class="col-sm-3 control-label">厂商地址：</label>
                <div class="col-sm-8">
                    <input id="address" name="address" th:field="*{address}" class="form-control" type="text">
                </div>
            </div>
		</form>
    </div>
    <div th:include="include::footer"></div>
    <script type="text/javascript">
		var prefix = ctx + "module/garden"
		$("#form-garden-edit").validate({
			rules:{
				xxxx:{
					required:true,
				},
				gardenName:{
					required:true,
					maxlength: 128
				},
				legalPerson:{
					required:true,
					maxlength: 64
				},
				phone:{
					required:true,
					isPhone:true,
				},
				productAdd:{
					required:true,
					maxlength: 255
				},
				address:{
					required:true,
					maxlength: 255
				}
			}
		});
		
		function submitHandler() {
	        if ($.validate.form()) {
	            $.operate.save(prefix + "/edit", $('#form-garden-edit').serialize());
	        }
	    }
	</script>
</body>
</html>
